package com.loadmore.schedule.adapter

import android.content.Context
import android.graphics.Color
import com.loadmore.common.base.BaseAdapter
import com.loadmore.common.base.RVBaseHolder
import com.loadmore.common.model.Schedule
import com.loadmore.schedule.R

class ScheduleListAdapter(context: Context) : BaseAdapter(context){

    override fun getLayoutId(): Int {
        return R.layout.layout_schedule_item
    }


    override fun onBindViewHolder(holder: RVBaseHolder<*>, position: Int) {
        super.onBindViewHolder(holder, position)
        val schedule = getItem(position) as Schedule
        holder.setText(R.id.name,schedule.name)
        if (System.currentTimeMillis() > schedule.end_time) {
            holder.getText(R.id.name).setTextColor(Color.RED)
        }
    }


}